import request from '@/utils/request.js'
import md5 from 'js-md5'
/**
 *
 * @param {登录} params
 */
export function Task (params) {
  return request({
    url: '/project/query',
    method: 'post',
    data: JSON.stringify(params),
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

export function AllTask (params) {
  return request({
    url: '/task/query',
    method: 'get',
    params
  })
}
// 项目id查询任务
export function TaskById (params) {
  return request({
    url: '/task/queryById',
    method: 'get',
    params
  })
}
// 新增任务
export function AddNewTask (params) {
  return request({
    url: '/task/updateAndAddTask',
    method: 'post',
    data: JSON.stringify(params),
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 查询
export function QueryTask (params) {
  return request({
    url: '/task/queryByType',
    method: 'get',
    params
  })
}

// 删除
export function DeleteTask (params) {
  return request({
    url: '/task/delete',
    method: 'get',
    params
  })
}

// 项目任务数量
export function QueryTaskNum (params) {
  return request({
    url: '/task/queryTaskNum',
    method: 'post',
    data: JSON.stringify(params),
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
// 项目负责人数
export function QueryTaskPeopleNum (params) {
  return request({
    url: '/user/queryPeopleNum',
    method: 'post',
    data: JSON.stringify(params),
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
// 上传文件
export function uploadFile (params) {
  return request({
    url: '/uploadFile',
    method: 'post',
    data:params,
    // params,
    headers: {
     'Content-Type':'multipart/form-data'
    }
  })
}


// 下载附件
export function download (params) {
  return request({
    url: '/download',
    method: 'get',
    params,
    responseType: "blob",

  })
}